<template>
  <div>
    <el-row :gutter="15" align="middle">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" align="middle">
        <el-col :span="11">
          <el-row :gutter="15">
            <el-col :span="15">
              <el-form-item label="用户名" prop="UserName">
                <el-input v-model="formData.UserName" placeholder="请输入用户名" clearable :style="{width: '100%'}">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="15">
              <el-form-item label="密码" prop="PassWord">
                <el-input v-model="formData.PassWord" placeholder="请输入密码" clearable show-password
                  :style="{width: '100%'}"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="15">
              <el-form-item label="手机号" prop="UserTel">
                <el-input v-model="formData.UserTel" placeholder="请输入手机号" clearable :style="{width: '100%'}">
                </el-input>
                <el-button @click="phone()" type="primary">手机短信获得验证码</el-button>
                <el-button @click="email()" type="primary">qq邮箱获得验证码</el-button>
              </el-form-item>
            </el-col>
            <el-col :span="15">
              <el-form-item label="验证码" prop="Code">
                <el-input v-model="formData.Code" placeholder="请输入验证码" clearable :style="{width: '100%'}">
                </el-input>
              </el-form-item>
            </el-col>
             <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
          </el-row>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data () {
    return {
      formData: {
        UserName: undefined,
        PassWord: undefined,
        UserTel: undefined,
        Code: undefined
      },
      rules: {
        UserName: [{
          required: true,
          message: '请输入用户名',
          trigger: 'blur'
        }],
        PassWord: [{
          required: true,
          message: '请输入密码',
          trigger: 'blur'
        }, {
          pattern: /^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/,
          message: '密码不合符规范',
          trigger: 'blur'
        }],
        UserTel: [{
          required: true,
          message: '请输入手机号',
          trigger: 'blur'
        }],
        Code: [{
          required: true,
          message: '请输入验证码',
          trigger: 'blur'
        }]
      }
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    submitForm () {
      this.$refs['elForm'].validate(valid => {

        // TODO 提交表单
      })
    },
    resetForm () {
      this.$refs['elForm'].resetFields()
    },
    phone () {

    },
    email () {

    }
  }
}

</script>
<style>
</style>
